home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17940 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.th-darmstadt.de!news
  2. From: Enno Sandner <enno@intellektik.informatik.th-darmstadt.de>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: [Q] Why doesn't this compile?
  5. Date: Thu, 18 Apr 1996 09:18:03 +0200
  6. Organization: Fachbereich Informatik, TH Darmstadt
  7. Message-ID: <3175ECAB.167EB0E7@intellektik.informatik.th-darmstadt.de>
  8. References: <317523C0.5042@eps.agfa.be>
  9. NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01 (X11; I; SunOS 4.1.3 sun4m)
  14.  
  15. Ranko Orlic wrote:
  16. > Using MSVC 4.0 compiler I get the following:
  17. > File test.cpp: ---------------------------------
  18. > class A {
  19. > public:
  20. >         class L {
  21. >         public:
  22. >                 L() {}
  23. >                 virtual void f() {
  24. >                         int dummy = 0;
  25. >                 }
  26. >         };
  27. >         A();
  28. > };
  29. > class B : public A {
  30. >         class L : public A::L {
  31. >         public:
  32. >                 L() {}
  33. >                 virtual void f() {
  34. >                         A::L::f();
  35. >                 }
  36. >         };
  37. >         B();
  38. > };
  39. > Compilation result: ----------------------------
  40. > test.cpp(18) : error C2352: 'A::L::f' : illegal call of
  41. > nonstatic member function
  42. > Error executing cl.exe.
  43. > test.obj - 1 error(s), 1 warning(s)
  44. > ------------------------------------------------
  45. > Anybody knows what's wrong with it?
  46.  
  47. I would say nothing - the given example should compile.
  48.  
  49.     Enno
  50.